package wechat.resources.app;

import wechat.resources.InstanceResource;
import wechat.util.aes.AesException;
import wechat.util.aes.WXBizMsgCrypt;

/**
 * wechat
 *
 */
public class app53 extends InstanceResource {
	
	private static final String PREFIX = "53";

	private static final String BaseURL = "https://www.exam.com";
	
	private static final String RedirectURI = "https%3A%2F%2Fweixin.exam.com%2FWechatWeb%2FServiceServlet%2F" + PREFIX;
	private static String Auth_URI = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri="
			+ RedirectURI + "&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
	
	private static String appid = INS.getValue(PREFIX +"." + APPID);
	private static String secret = INS.getValue(PREFIX +"." + SECRET);
	private static String token = INS.getValue(PREFIX +"." + TOKEN);
	private static String encodingAESKey = INS.getValue(PREFIX +"." + ENCODINGAESKEY);
	private static String corpid = INS.getValue(PREFIX +"." + CORPID);
	private String auth = Auth_URI;
	
	private static String menu = BaseURL + "/preService/"+ appid +"?state=10";
	
	private WXBizMsgCrypt wxBizMsgCrypt;
	
	public app53(){
	
	}

	@Override
	public String getAppid() {
		return appid;
	}

	@Override
	public String getSecret() {
		return secret;
	}

	@Override
	public String getToken() {
		return token;
	}

	@Override
	public String getEncodingAESKey() {
		return encodingAESKey;
	}

	@Override
	public String getCorpid() {
		return corpid;
	}

	@Override
	public WXBizMsgCrypt getWXBizMsgCrypt() throws AesException {
		if (wxBizMsgCrypt == null) {
			wxBizMsgCrypt = new WXBizMsgCrypt(getToken(), getEncodingAESKey(), getCorpid());
		}
		return wxBizMsgCrypt;
	}

	@Override
	public String getAuth() {
		return auth;
	}

	
	
}
